Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datadir automatic sync #126

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jemacchi
Copy link

@jemacchi jemacchi commented Jan 6, 2025

This PR implements the functional requirements mentioned in the ticket #75.

The goal is to automatically restart or reload the config of all the geOrchestra applications when there is a new commit in the geOrchestra datadir. That would allow for easier management of the datadir in test environments.

The implementation includes a new component (datadirsync) that is deployed with certain permissions to access the
kubernetes API.

This component implements python code that actively listens to a given git repository, in a certain branch, at defined time intervals looking for changes in the repository. If this happens, it then invokes through the k8s API the rollout of the deployments listed in the deploymentSuffixNameList variable considering the predefined namespace.

Since in the context of Georchestra the SDI components update the datadir at initialization (https://github.com/georchestra/helm-georchestra/blob/main/templates/_bootstrap-georchestra-datadir.tpl) the rollout of a component guarantees that when restarting, it reloads the necessary configuration information.

The template accepts the definition of the username and password of the user with which the checks are made on the git repository, or that an sshkey is used (in which case it will be included in the corresponding container).

For details of the logic, review the template/datadirsync-deployment.yaml file.

The python implementation that executes the repository status check actions is momentarily in the following repository/folder https://github.com/jemacchi/simple-git-rollout-operator/tree/main/operator .

Initially, it was expected to perhaps create a somewhat more robust solution, but since it is a component that is not expected to be used in production environments, a simpler solution was chosen, which makes use of the Kubernetes API natively, with a component that does not involve CRD installation, and that has the minimum and necessary RBAC permissions to perform the relevant action.

@jemacchi jemacchi requested a review from edevosc2c January 6, 2025 20:28
@jemacchi jemacchi marked this pull request as draft January 6, 2025 20:28
values.yaml Outdated Show resolved Hide resolved
templates/datadirsync/datadirsync-role.yaml Show resolved Hide resolved
templates/datadirsync/datadirsync-role.yaml Outdated Show resolved Hide resolved
values.yaml Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
values.yaml Show resolved Hide resolved
@edevosc2c
Copy link
Member

Hello jose, thank you for your contribution.

I have reviewed your PR. Could you also please put a description to your PR so that other contributors understand what is it? You can also reference that it will close #75

@jemacchi jemacchi requested a review from edevosc2c January 29, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants